﻿namespace Legend.Autofac
{
    using System;
    using global::Autofac;
    using Legend.IoCo;

    public class AutofacLocator
        : IComponentResolver
    {
        private IContext context;

        public AutofacLocator(IContext context)
        {
            this.context = context;
        }

        public bool TryResolve(Type typeToResolve, out object result)
        {
            return this.context.TryResolve(typeToResolve, out result);
        }
    }
}